import Vue from "vue"
import VueRouter from "vue-router"

/*
import ElementUIDemo from "@/pages/ElementUIDemo"
import login from "@/pages/login"
import main from "@/pages/main"
import userpage from "@/pages/userpage"
*/
import index from "@/pages/index"
import goods from "@/pages/goods"
import register from "@/pages/register"
import login from "@/pages/login"
import shop from "@/pages/shop"
import shopregister from "@/pages/shopregister"
import changshop from "@/pages/changshop"
import productsshow from "@/pages/productsshow"
import detail from "@/pages/detail"
import paypage from "@/pages/paypage"
import paySuccess from "@/pages/paySuccess"
import seckill_index from "@/pages/seckill_index"
import seckilldetail from "@/pages/seckilldetail"
import purchased from "@/pages/purchased"

import products from "@/pages/shoppage/products"
import upproduct from "@/pages/shoppage/upproduct"
import order from "@/pages/shoppage/order"
import return_goods from "@/pages/shoppage/return_goods"
import coupon from "@/pages/shoppage/coupon"
import seckill from "@/pages/shoppage/seckill"

import adminindex from "@/pages/adminindex"
import allshop from "@/pages/adminpage/allshop"
import checkshop from "@/pages/adminpage/checkshop"
import coupon_backstage from "@/pages/adminpage/coupon"
import seckill_backstage from "@/pages/adminpage/seckill"
import shopcheck from "@/pages/adminpage/shopcheck"
import shopupdate from "@/pages/adminpage/shopupdate"
import topsell from "@/pages/adminpage/topsell"
import payrefund from "@/pages/adminpage/payrefund"
import topproduct from "@/pages/adminpage/topproduct"
import user from "@/pages/adminpage/user"
import role from "@/pages/adminpage/role"
import order_backstage from "@/pages/adminpage/order"
import refund from "@/pages/adminpage/refund"

Vue.use(VueRouter)

/*
const routes = [
    {path: "/elementUIDemo",component:ElementUIDemo},
    {path: "/login",component:login},
    {
        path: "/main",component:main,
        children:[
            {path: "/user/userpage",component:userpage}
        ]
    }
]
*/
const routes = [
    {path: "/",component:index},
    {path: "/goods",component:goods},
    {path: "/register",component:register},
    {path: "/login",component:login},
    {path: "/productsshow",component:productsshow},
    {path: "/detail",component:detail},
    {path: "/paypage",component:paypage},
    {path: "/paySuccess",component:paySuccess},
    {path: "/seckill_index",component:seckill_index},
    {path: "/seckilldetail",component:seckilldetail},
    {path: "/purchased",component:purchased},
    {
        path: "/adminindex",component:adminindex,
        children:[
            {path: "/allshop",component:allshop},
            {path: "/checkshop",component:checkshop},
            {path: "/coupon_backstage",component:coupon_backstage},
            {path: "/seckill_backstage",component:seckill_backstage},
            {path: "/shopcheck",component:shopcheck},
            {path: "/shopupdate",component:shopupdate},
            {path: "/topsell",component:topsell},
            {path: "/payrefund",component:payrefund},
            {path: "/topproduct",component:topproduct},
            {path: "/user",component:user},
            {path: "/role",component:role},
            {path: "/order_backstage",component:order_backstage},
            {path: "/refund",component:refund}
        ]
    },
    {path: "/shopregister",component:shopregister},
    {path: "/changshop",component:changshop},
    {
        path: "/shop",component:shop,
        children:[
            {path: "/products",component:products},
            {path: "/upproduct",component:upproduct},
            {path: "/order",component:order},
            {path: "/return_goods",component:return_goods},
            {path: "/coupon",component:coupon},
            {path: "/seckill",component:seckill},
        ]
    }

]

const router = new VueRouter({
    mode:"history",
    routes
})


export default router